#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int n;
	while (scanf("%d",&n),n) {
		int sum = 1;
		int t = 0;
		scanf("%d", &t);
		int x = 0;
		for (int i = 0; i < n -1 ; i++) {
			scanf("%d", &x);
			if (x > t)sum++;
			t = x;
		}
		cout << sum << endl;
	}
	return 0;
}